package cn.china.springboot;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;


//springboot默认扫描mysql相关的配置,如果没有配置mysql相关连接参数,启动会报错
//exclude = DataSourceAutoConfiguration.class:让springboot不自动扫描数据库的配置
@SpringBootApplication
@ComponentScan({"entity","interceptor","config","controller","service.impl"})
@MapperScan("mapper")
public class SpringbootApplication {//springboot启动类
    //1.springboot会自动扫描当前启动类所在的包及其子包中的类
    //2.当需要扫描别的包中类时，需要在启动类上使用@ComponentScan注解,指定需要扫描的包
    public static void main(String[] args) {
        SpringApplication.run(SpringbootApplication.class, args);
    }

}
